#!/usr/bin/env python 
# -*- coding: utf-8 -*-
# @Time    : 2022/9/19 8:25
# @Author  : Junzhao
# @File    : 约瑟夫生者死者小游戏.py
# @Software: PyCharm
people = {}
for x in range(1, 31):
    people[x] = 1
print(people)
counter = 0
i = 1
j = 0
while i <= 31:
    if i == 31:
        i = 1
    elif j == 15:
        break
    else:
        if people[i] == 0:
            i += 1
            continue
        else:
            counter += 1
            if counter == 9:
                people[i] = 0
                counter = 0
                print(f"{i}号下船了")
                j += 1
            else:
                i += 1
                continue
print(people)
